package com.khiker.binary;

public class P191_HammingWeight {
	public int hammingWeight(int n) {
		int count = 0;
		while (n != 0) {
			if ((n & 1) != 0) {
				count++;
			}
			n >>>= 1;
		}
		return count;
	}

	public static void main(String[] args) {
		P191_HammingWeight solution = new P191_HammingWeight();
		System.out.println(solution.hammingWeight(-3));
	}
}
